package org.springblade.resource.config;

import cn.hutool.core.util.IdUtil;
import org.springblade.core.oss.rule.OssRule;
import org.springblade.core.tool.utils.DateUtil;

/**
 * 图片储存规则
 *
 * @author wm
 */
public class ImgOssRule implements OssRule {
	@Override
	public String bucketName(String bucketName) {
		return bucketName;
	}

	@Override
	public String fileName(String originalFilename) {
		return "img/" + DateUtil.today() + "/" + IdUtil.simpleUUID() + "-" + originalFilename;
	}
}
